<!DOCTYPE html>
<html>
<head>
    {include file='public/meta'/}
    <script src="__STATIC_URL__/static/js/liandong.js" type="text/javascript" charset="utf-8"></script>


    <style>

    </style>
</head>
<body>
{include file='public/header'/}
<section>
    <!------------------导航-------------------------->
    {include file='public/left'/}
    <!--------------------------主要内容区域------------------------------------->
    <div class="content">
        <div class="page-heading mgr15 mgl15">
            <ul class="breadcrumb">
                <li>当前位置是：</li>
                <li><a href="{:url('cardus/cardinfo',['card_id'=>$card['card_id']])}">会员卡</a></li>
                <li><a href="{:url('shop/shopmall',['card_id'=>$card['card_id']])}"> 积分商城</a></li>
                <li><a href="javascript:history.back();">类目列表</a></li>
                <li class="active" style="color: #02b87f;">类目修改</li>
            </ul>
        </div>
        <div class="panel mgr15 mgl15">
            <div class="panel-heading addCharts" style="background:#ededed;">
                修改类目
            </div>
            <div class="panel-body">
                <form class="form-horizontal adminex-form" action="" method="post">

                    <div class="panel panel-default" id="step1">
                        <div class="panel-body">

                            <div class="pull-left alert form form-area col-sm-12 col-md-12 " style="display: block; margin-top: 0.5px;">

                                <div class="form-group">
                                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">商品名称：</label>
                                    <div class="col-sm-9 col-xs-12 coupon-color">
                                        <input type="text" class="form-control" name="name"  value="{$info.name}">
                                        <input type="hidden" class="form-control" name="id"  value="{$info.id}">
                                    </div>
                                </div>


                                <div style="text-align: center">
                                    <button type="button" class="btn btn-primary" id="add">修改</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>

        {include file='public/footer'/}
    </div>
</section>

</body>


<script>




    $("#add").click(function(){
        var cate_name = $("#cate_name").val();

        if(cate_name == ""){
            layer.alert("名称不能为空");
            return false;
        }

        $.ajax({
            //几个参数需要注意一下
            type: "POST",//方法类型
            dataType: "json",//预期服务器返回的数据类型
            url: "{:url('')}" ,//url
            data: $('.adminex-form').serialize(),
            success: function (res) {
                console.log(res);
                if (res.code == 0) {
                    layer.msg('修改成功');
                    setTimeout(function(){
                        window.location.href=res.url
                    },1000);

                }else{
                    layer.msg('修改失败');
                }
            },
            error : function() {
                alert("异常！");
            }
        });
    });

</script>



</html>
